package com.test.qpbgboot.base.quartz;

import com.test.qpbgboot.base.utils.SpringContextUtils;
import com.test.qpbgboot.schedule.service.ScheduleService;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.quartz.JobExecutionContext;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * 每周一凌晨一点定时生成下下周的房间和陪玩排班
 */
@Slf4j
public class SchedulingJob extends QuartzJobBean {
    @Override
    protected void executeInternal(@NotNull JobExecutionContext context) {
        log.debug("自动排班-定时任务-运行");

        ScheduleService scheduleService = SpringContextUtils.getBean(ScheduleService.class);
        scheduleService.roomAndEscortScheduleGenerate();
    }
}
